package com.xinyue.game.fish.common;

import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.xinyue.game.logic.frame.XinyueGameServerBoot;

public enum EnumRedisKey {
	PlayerBasic, Rank

	;

	public String getRedisKey(long playerId) {
		String key = getRedisKey();
		return key + ":" + playerId;
	}

	public String getRedisKey() {
		NacosDiscoveryProperties nacosDiscoveryProperties = XinyueGameServerBoot.getSpringContext()
				.getBean(NacosDiscoveryProperties.class);
		String namespace = nacosDiscoveryProperties.getNamespace();
		return namespace + ":" + this.name().toLowerCase();
	}
}
